Skip to content

Conversation

@osleg
Copy link
Collaborator

@osleg osleg commented Nov 5, 2019

This commit introduces breaking changes due to changes in config file
format.

  • Added swipe threshold.

  • Added a configurable treshold variable to pinch gesture.
    I felt that pinch gesture is kinda tricky to execute on touchpad,
    so I changed a way of calculation when to trigger the command and
    added the distance for fingers travel to configuration.
    Basically a 0.5 distance feels quite ok to me, but it becomes really
    snappy at 0.1.

  • Reorganized code a little bit

    • Previously swipe gesture was triggered only when fingers leaving
      touchpad thus threshold was useless. Moved trigger function outside
      of event handling.
    • Created reset functions for gestures to reset struct holding event
      data to default values.
  • Config keys changed format, see readme for examples.

  • Both swipe and pinch gestures now have settings.threshold key which can be
    values 0.0 - 1.0.
    Defaults:
    Swipe: 1.0
    Pinch: 0.25

  • Both swipe and pinch now have settings.one_shot which, if set,
    allows only one execution of command per gesture.
    Defaults:
    Swipe: true
    Pinch: false

  • Swipe gesture now has settings.trigger_on_release defaulting to
    false. If set to true the command for swipe will be triggered when
    fingers are moved from touchpad UNLESS it is also one_shot gesture and
    gesture was already triggered.

osleg and others added 8 commits October 30, 2019 19:22
Basic implementation enables one shot pinch gesture.
That is the command from config file will run only once as soon as
fingers move 50% from the initial fingers position.

- Added a configurable distance variable to pinch gesture.
I felt that pinch gesture is kinda tricky to execute on touchpad,
so I changed a way of calculation when to trigger the command and
added the distance for fingers travel to configuration.
Basically a `0.5` distance feels quite ok to me, but it becomes really
snappy at `0.1`.
Pinch Gesture
* Reorganized code a little bit
  - Previously swipe gesture was triggered only when fingers leaving
    touchpad thus threshold was useless. Moved trigger function outside
    of event handling.
  - Created reset functions for gestures to reset struct holding event
    data to default values.

* Added swipe threshold.
  - Added new config keys
    * `settings.pinch.distance` - now instead of
      `pinch.commands.distance` holds the value required for fingers to
      travel before executing pinch gesture.
    * `settings.swipe.threshold` - new key to set how long should be
      swipe to execute command.
This commit introduces breaking changes due to changes in config file
format. Hopefully that's the last time.

* Config keys changed format, see readme for examples.
* Both swipe and pinch gestures now have `settings.threshold` key which can be
  values 0.0 - 1.0.
  Defaults:
    Swipe: 1.0
    Pinch: 0.25
* Both swipe and pinch now have `settings.one_shot` which, if set,
  allows only one execution of command per gesture.
  Defaults:
    Swipe: true
    Pinch: false
* Swipe gesture now has `settings.trigger_on_release` defaulting to
  false. If set to true the command for swipe will be triggered when
  fingers are moved from touchpad UNLESS it is also one_shot gesture and
  gesture was already triggered.
Removed fork info
@vimpostor
Copy link
Collaborator

Can you elaborate on what you mean with continuous pinch and swipe gestures?

@osleg
Copy link
Collaborator Author

osleg commented Nov 24, 2019

one time gesture is getting triggered once as soon as the swipe or pinch threshold is reached.
Continous is triggered multiple times each time the threshold is reached.

For example pinch in gesture executing xdotool key control++, with threshold set to 0.2 the xdotool command will be executed 5 times before fingers meet in the middle.

@Coffee2CodeNL
Copy link
Owner

@osleg wanna merge this back into this repo? :)

@osleg
Copy link
Collaborator Author

osleg commented Feb 13, 2020

Sure, do you want the entire fork?

@Coffee2CodeNL
Copy link
Owner

That'd be great, if you want I could add you as collaborator to this repo? :)

@Coffee2CodeNL
Copy link
Owner

@osleg ?

@osleg
Copy link
Collaborator Author

osleg commented Mar 13, 2020

@Coffee2CodeNL sorry took me some time ^_^
#35 prepped for merge with latest changes, features and bugs 😆
Closing this one

@osleg osleg closed this Mar 13, 2020
@osleg osleg deleted the to-upsteam branch March 13, 2020 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants